home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / grafica / amhelios / parse.h < prev    next >
C/C++ Source or Header  |  1999-01-01  |  3KB  |  88 lines

  1. ////////////////////////////////////////////////////////////
  2. //
  3. /// PARSE.H - Environment Data File Parser Class
  4. //
  5. //  Version:    1.03A
  6. //
  7. //  History:    94/08/23 - Version 1.00A release.
  8. //              94/12/16 - Version 1.01A release.
  9. //              95/02/05 - Version 1.02A release.
  10. //              95/07/21 - Version 1.02B release.
  11. //              96/02/14 - Version 1.02C release.
  12. //              96/04/01 - Version 1.03A release.
  13. //
  14. //  Compilers:  Microsoft Visual C/C++ Professional V1.5
  15. //              Borland C++ Version 4.5
  16. //
  17. //  Author:     Ian Ashdown, P.Eng.
  18. //              byHeart Software Limited
  19. //              620 Ballantree Road
  20. //              West Vancouver, B.C.
  21. //              Canada V7S 1W3
  22. //              Tel. (604) 922-6148
  23. //              Fax. (604) 987-7621
  24. //
  25. //  Copyright 1994-1996 byHeart Software Limited
  26. //
  27. //  The following source code has been derived from:
  28. //
  29. //    Ashdown, I. 1994. Radiosity: A Programmer's
  30. //    Perspective. New York, NY: John Wiley & Sons.
  31. //
  32. //  It may be freely copied, redistributed, and/or modified
  33. //  for personal use ONLY, as long as the copyright notice
  34. //  is included with all source code files.
  35. //
  36. ////////////////////////////////////////////////////////////
  37.  
  38. #ifndef _PARSE_H
  39. #define _PARSE_H
  40.  
  41. #include "environ.h"
  42. #include "transfm3.h"
  43. #include "win_text.h"
  44.  
  45. #define MaxLine 256     // Maximum line length
  46.  
  47. typedef Patch3 *PatchPtr;       // Patch pointer data type
  48. typedef Surface3 *SurfacePtr;   // Surface pointer data type
  49. typedef Vertex3 *VertexPtr;     // Vertex pointer data type
  50.  
  51. class Parse     // Environment data file parser
  52. {
  53.   private:
  54.     WORD elem_cnt;              // Instance element count
  55.     WORD patch_cnt;             // Instance patch count
  56.     WORD surf_cnt;              // Instance surface count
  57.     WORD vert_cnt;              // Instance vertex count
  58.     char ent_buff[MaxLine];     // Entity file name buffer
  59.     char line_buff[MaxLine];    // Line buffer
  60.     char msg_buff[MaxLine];     // Message buffer
  61.     Environ *penv;              // Environment pointer
  62.     PatchPtr *pp_array;         // Patch pointer array ptr
  63.     SurfacePtr *ps_array;       // Surface pointer array ptr
  64.     Transform3 tm;              // 3-D transformation matrix
  65.     VertexPtr *pv_array;        // Vertex pointer array ptr
  66.     WinText efile;              // Entity file
  67.     WinText ifile;              // Instance file
  68.  
  69.     BOOL ParseElements();
  70.     BOOL ParsePatches();
  71.     BOOL ReadVector( WinText &, double *, double *,
  72.        double * );
  73.     Instance *ParseEntityFile();
  74.     Surface3 *ParseSurfaces();
  75.     Surface3 *ReadSurface();
  76.     Vertex3 *ParseVertices();
  77.     Vertex3 *ReadVertex();
  78.     void ReadLine( WinText & );
  79.     void ReadTransform();
  80.     void TransformInstance( Instance * );
  81.  
  82.   public:
  83.     BOOL ParseFile( char *, char *, Environ * );
  84. };
  85.  
  86. #endif
  87.  
  88.